package com.hh.game.service.gateway.manager.service.config;

import cn.hutool.core.io.FileUtil;

import java.nio.charset.Charset;

public class DefaultConfigResourceReader implements ConfigResourceReader {
    @Override
    public String read(ConfigResource resource) {
        try {
            if(resource.isFile()){
                return FileUtil.readString(resource.getFile(), Charset.defaultCharset());
            }else {
                return (String) resource.getData();
            }
        }catch (Exception e){

        }
        return null;
    }
}
